package com.sinven.serivce;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinven.mapper.ClassificationMapper;
import com.sinven.pojo.Classification;

@Service
public class ClassificationSerivceImpl implements ClassificationSerivce{
	
	@Autowired   
	private ClassificationMapper classificationMapper;
	/**
	 * 添加
	 */
	@Override
	public Boolean addclassification(Classification classification) {
		//调用classificationMapper中的addclassification，返回一个int的result
		int result = classificationMapper.addclassification(classification);
		//使用if判断如果result>0返回true否则返回false
		if(result>0) {
			return true;
		}
		return false;
	}
	/**
	 *修改
	 */
	@Override
	public Boolean updateclassification(Classification classification) {
		//调用classificationMapper中的updateclassification，返回一个int的result
		int result = classificationMapper.updateclassification(classification);
		//使用if判断如果result>0返回true否则返回false
		if(result>0) {
			return true;
		}
		return false;
	}
	/**
	 * 删除
	 */
	@Override
	public Boolean deleteclassification(Long cid) {
		//调用classificationMapper中的deleteclassification，返回一个int的result
		int result = classificationMapper.deleteclassification(cid);
		//使用if判断如果result>0返回true否则返回false
		if(result>0) {
			return true;
		}
		return false;
	}
	/**
	 * 查询所有
	 */
	@Override
	public List<Classification> queryAll() {
		return classificationMapper.queryAll();
	}
	
}
